home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / amok_lha / amok83.lha / SetMode / SetMode.mod < prev    next >
Encoding:
Text File  |  1993-08-15  |  2.1 KB  |  71 lines

  1. (*----------------------------------------------------------------------------
  2.  :Program.     SetMode.mod
  3.  :Contents.    Prozedur, mir der man ein CON: Fenster in den RAW: Modus
  4.  :Contents.    setzen kann, macht also dasselbe wie die gleichnamige Funktion
  5.  :Contents.    der dos.library V36 und höher.
  6.  :Author.      Christian Stiens
  7.  :Address.     Snail-Mail:           E-Mail:
  8.  :Address.     Heustiege 2           UUCP: Christian_Stiens@ouzonix.bo.open.de
  9.  :Address.     W-4710 Lüdinghausen   FIDO: 2:245/5802
  10.  :Copyright.   public domain
  11.  :Language.    Oberon-2
  12.  :Translator.  Amiga Oberon V2.45d (inofficial beta-version)
  13.  :History.     V1.0, 21-Nov-92: first release
  14.  :Support.     Chuck McManis (RawIO, FF #85)
  15. ----------------------------------------------------------------------------*)
  16.  
  17. MODULE SetMode;
  18.  
  19. IMPORT d:=Dos, e:=Exec, es:ExecSupport, SYS:=SYSTEM;
  20.  
  21.  
  22. PROCEDURE SendPacket (procId : e.MsgPortPtr;
  23.                       action : LONGINT;
  24.                       args   : ARRAY OF LONGINT): LONGINT; (* $CopyArrays- *)
  25. VAR
  26.   replyport  : e.MsgPortPtr;
  27.   packet     : d.StandardPacketPtr;
  28.   count,res1 : LONGINT;
  29.   pargs      : UNTRACED POINTER TO ARRAY 7 OF LONGINT;
  30.  
  31. BEGIN
  32.   replyport := es.CreatePort("",0);
  33.   IF replyport=NIL THEN RETURN 0 END;
  34.   packet := e.AllocMem(SIZE(packet^),LONGSET{e.public,e.memClear});
  35.   IF packet=NIL THEN
  36.     es.DeletePort(replyport);
  37.     RETURN 0
  38.   END;
  39.   packet.msg.node.name := SYS.ADR(packet.pkt);
  40.   packet.pkt.link      := SYS.ADR(packet.msg);
  41.   packet.pkt.port      := replyport;
  42.   packet.pkt.type      := action;
  43.   pargs := SYS.ADR(packet.pkt.arg1);
  44.   FOR count := 0 TO LEN(args)-1 DO
  45.     pargs[count] := args[count]
  46.   END;
  47.   e.PutMsg(procId,packet);
  48.   e.WaitPort(replyport);
  49.   SYS.SETREG(0,e.GetMsg(replyport));
  50.   res1 := packet.pkt.res1;
  51.   e.FreeMem(packet,SIZE(packet^));
  52.   es.DeletePort(replyport);
  53.   RETURN res1
  54. END SendPacket;
  55.  
  56.  
  57. PROCEDURE SetMode* (fh     : d.FileHandlePtr;
  58.                     mode   : LONGINT): LONGINT;
  59. VAR
  60.   Arg : ARRAY 1 OF LONGINT;
  61.  
  62. BEGIN
  63.   IF ~d.IsInteractive(fh) THEN RETURN 0 END;
  64.   Arg[0] := mode;
  65.   RETURN SendPacket(fh.type,d.screenMode,Arg);
  66. END SetMode;
  67.  
  68.  
  69. END SetMode.
  70.  
  71.